#ifndef EDITCOMMODITY_H
#define EDITCOMMODITY_H

#include <QDialog>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QMessageBox>

namespace Ui {
class EditCommodity;
}

class EditCommodity : public QDialog
{
    Q_OBJECT

public:
    explicit EditCommodity(QWidget *parent = nullptr, const QString &stockId = "");
    ~EditCommodity();

private slots:
    void on_exitButton_clicked();

    void on_addButton_clicked();

private:
    Ui::EditCommodity *ui;

    QString m_stockId;  // 当前编辑的商品ID

    void loadCommodityData();  // 加载商品数据
    bool updateCommodityData(); // 更新商品数据
};

#endif // EDITCOMMODITY_H
